home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 138 / pascal / clipas.doc next >
Encoding:
Text File  |  1987-05-13  |  6.1 KB  |  236 lines

  1. Using Personal Pascal with a CLI
  2. --------------------------------
  3.  
  4. Several Command Line Interpreters are
  5. now available for the ST, including
  6. (for example only) Micro C-Shell.
  7.  
  8. Several of you have asked for a way
  9. to use PPascal from such a CLI.  Well
  10. it turns out the PPascal was designed
  11. from the start to work this way, and
  12. the use from GEM menus is actually  
  13. accomplished using the CHAIN function
  14. of GEMDOS!  If you prefer, you can
  15. ignore the PASCAL.PRG "shell" and
  16. use COMPILER.PRG, EDITOR.PRG, and
  17. LINKER.PRG directly.  Each of these
  18. programs has some options, summarized
  19. below:
  20.  
  21. =====================================
  22.  
  23. EDITOR fnm [ line [ col [ err ] ] ]
  24.   
  25. You MUST pass a file name ("fnm") to
  26. the editor.  You may optionally pass
  27. a line number, in which case when the
  28. editor loads and runs the cursor will
  29. be positioned at the specified line
  30. number.  (CAUTION: be sure to use a
  31. line number that exists in the file!)
  32.  
  33. If you pass a line number, you may
  34. also pass a column number.  Again, if
  35. you do so, the cursor will be placed
  36. at that column in the given line.
  37.  
  38. Finally, only if you specify a line
  39. number and a column number, you may
  40. also specify an error number.  If you
  41. do so, and if that error number is   
  42. the same as one in the file named
  43. "ERRORS.TXT" then the corresponding
  44. error message will appear at the top
  45. of the editor screen.
  46.  
  47. Example:                      
  48.  
  49.   EDITOR MYPROG.PAS 20 10 167
  50.  
  51. Causes the Editor to load the file
  52. MYPROG.PAS, set the cursor at line 20
  53. and column 10, and displays the error
  54. message "Undeclared Label" at the top
  55. of the screen.
  56.  
  57. =====================================
  58.  
  59. COMPILER fnm [/GEM] [/NOCODE] [/ACC]
  60.              [/DEBUG] [/NOCHECK]
  61.              [/CHECK] [/CLEAR]
  62.  
  63. You MUST pass a file name ("fnm") to
  64. the compiler.  The source file MUST
  65. have the extension ".PAS" (as in
  66. MYPROG.PAS). The object file produced
  67. by the compiler WILL be given a name
  68. of the same form as the source file
  69. (in the same directory) but with the
  70. extension ".O" (e.g., MYPROG.O).
  71.  
  72. You may pass one of several optional 
  73. parameters.  Each must be preceded by
  74. a slash ("/") and they must be separ-
  75. ated from each other by a space.  All
  76. the options are INDEPENDENT of each
  77. other, and each overrides whatever
  78. the compiler's default condition is!
  79.  
  80. Each option is explained below:
  81.  
  82. -------------------------------------
  83.  
  84. /GEM
  85.  
  86. Compile for GEM.  Default is compile
  87. for TOS.  Roughly same as coding the
  88. compiler directive $U10 (reserve 10kb
  89. or memory for GEM, in other words).
  90.  
  91. -------------------------------------
  92.  
  93. /NOCODE
  94.  
  95. Do not produce an object file!  This
  96. is really handy when you are doing 
  97. the first few compiles of a program,
  98. when you're expecting several errors.
  99. Obviously, the default is DO produce
  100. an object file.
  101.  
  102. -------------------------------------
  103.  
  104. /ACC
  105.  
  106. Make this program a desk accessory.
  107. Default is a GEM or TOS program.
  108. This has the same effect as coding
  109. the compiler directive "$A+" in your
  110. program.
  111.  
  112. CAUTION::  Do NOT use this option if
  113. you do not have version 1.10 or later
  114. of the Personal Pascal compiler.
  115.  
  116. -------------------------------------
  117.  
  118. /DEBUG
  119.  
  120. Causes compiler to generate the code
  121. needed for the "debug" mode (see PP
  122. manual).  Same as compiler directive
  123. "$D+".
  124.  
  125. -------------------------------------
  126.  
  127. /NOCHECK
  128.  
  129. Same as using the compiler directive
  130. "$T-".  That is, it turns of stack/
  131. heap overlap checking.  This checking
  132. is NOT a lot of overhead, so we do
  133. not recommend using this option until
  134. your code if pretty well finalized.
  135.  
  136. -------------------------------------
  137.  
  138. /CHECK
  139.  
  140. Same as using BOTH of the compiler
  141. directives "$P+" and "$R+".
  142.  
  143. NOTE:: This directive is definitely
  144. NOT the opposite of /NOCHECK.  The 
  145. two are completely separate and inde-
  146. pendent!
  147.  
  148. Pointer and range checking DO use
  149. considerable system overhead, but we
  150. still recommend that you use them 
  151. until you are reasonably sure that
  152. your program is not pointing off into
  153. never-never land.
  154.  
  155. -------------------------------------
  156.  
  157. /CLEAR
  158.  
  159. Same as compiler directive "$C+".
  160.  
  161. Clearing variables to zero is NOT a
  162. thing that most Pascal compilers do,
  163. so for compatibility you should not
  164. use this directive.  Exception:  if
  165. you are converting from Turbo Pascal,
  166. this might be handy.
  167.  
  168. -------------------------------------
  169.  
  170. EXAMPLE:
  171.  
  172. COMPILER MYPROG /GEM /CHECK /DEBUG
  173.  
  174.  
  175.  
  176. =====================================
  177.  
  178. LINKER fnm1,fnm2,fnm3,...fnmN
  179.   or
  180. LINKER fnm.ext=fnm1,fnm2,fnm3...,fnmN
  181.  
  182. The LINKER has no specifiable options
  183. but it does have two ways to specify
  184. the files to be linked and the name
  185. of the resultant output file.
  186.  
  187. The first form shown above will cause
  188. all the specified files to be linked
  189. together.  The files may be either
  190. object (".O") files or library files
  191. (such as PASLIB and PASGEM).  The 
  192. output file will ALWAYS be named
  193. "fnm1.PRG".  That is, it will have
  194. the same name as the first file in
  195. the list but will have the extension
  196. ".PRG".  If the program is not a GEM
  197. program, we recommend renaming the
  198. file after it is produced.
  199.  
  200. The second form shown allows you to
  201. specify ANY file name for the output
  202. file.  This is handy when you want
  203. the output file to be in some other
  204. directory or to have some extension
  205. other than ".PRG".  (For example, the
  206. PASCAL GEM-based shell specifies 
  207. ".TOS" when you click on the "link 
  208. for TOS" button.)
  209.  
  210. REMEMBER:  PASLIB should probably be
  211. the last file linked in any case.
  212. If you are linking for GEM, then
  213. PASGEM should be the next to last
  214. file in the list.
  215.  
  216. BUG:  Although you may specify almost
  217. any pathname for each of the given 
  218. files, you can NOT use a name that
  219. starts with "..\".  If you need to
  220. go up a level in the directory, you
  221. will have to do so by giving the path
  222. more explicitly.
  223.  
  224. =====================================
  225.  
  226. And that's it.  There are a few other
  227. options for the COMPILER that are
  228. only useful if you are running in a
  229. GEM shell environment (e.g., as does
  230. PASCAL.PRG).  If you are writing a
  231. replacement GEM type shell, contact 
  232. us for more info.
  233.  
  234. =====================================
  235. =====================================
  236.